//
//  TTSDiscoverHomeCollectionViewCell.m
//  TTSVideo
//
//  Created by Zhai on 16/2/29.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "TTSDiscoverHomeCollectionViewCell.h"

@interface TTSDiscoverHomeCollectionViewCell ()

@property (nonatomic,retain)UIImageView *backImageView;
@property (nonatomic,retain)UILabel *titleLabel;

@end

@implementation TTSDiscoverHomeCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
    
}

- (void)createSubViews{
    
    
    self.backImageView = [[UIImageView alloc]initWithFrame:self.contentView.frame];
    self.backImageView.backgroundColor = [UIColor yellowColor];
       [self.contentView addSubview:self.backImageView];
    
    self.titleLabel = [[UILabel alloc]initWithFrame:self.contentView.frame];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.textColor = [UIColor whiteColor];
    self.titleLabel.shadowColor = [UIColor whiteColor];
    self.titleLabel.shadowOffset = CGSizeMake(0.5, 0.5);
    
    [self.backImageView addSubview:self.titleLabel];
    
    
}

- (void)setModel:(TTSDiscoverModel *)model{
   
    self.titleLabel.text = model.name;
    
    [self.backImageView sd_setImageWithURL:[NSURL URLWithString:model.bgPicture]];

}
@end
